package yawning.mew.cat;

import yawning.mew.sim.SimulationAction;

public class SkullBashAction implements SimulationAction {
	private CatModelSimState mState;
	public double mCooldownAt;

	SkullBashAction(CatModelSimState state) {
		mState = state;
	}

	public double perform() {
		int cost = mState.mModel.skullBashCost;	// XXX: Is this affected by Berserk/Clearcasting?
		if (mCooldownAt > mState.mSimUtil.getSimTime() || mState.energyTickEv.mEnergy < cost) return SimulationAction.ACTION_FAIL;

		mCooldownAt = mState.mSimUtil.getSimTime() + mState.mModel.skullBashCDDuration;

		if (mState.mDebug) mState.DBGF("Skull Bash");

		return 0.0f;
	}
}
